<link href="/classico/public/assets/modules/toolbar.css" rel="stylesheet" type="text/css"/>
<?php
$actionName = $this->actionName;
$controllerName = $this->controllerName;
?>
<div id="toolbar">
    <div>
        <?= $actionName . ' ' . $controllerName ?>
    </div>
    <ul>
        <li id="tool-btn-apply" class="enabled-tool-btn">
            <div class="enabled-apply-icon tool-icon"></div>
            <span>Apply</span>
        </li>
        <li id="tool-btn-applynclose" class="enabled-tool-btn">
            <div class="enabled-applynclose-icon tool-icon"></div>
            <span>A&Close</span>
        </li>
        <li id="tool-btn-applynnew" class="enabled-tool-btn">
            <div class="enabled-applynnew-icon tool-icon"></div>
            <span>A&New</span>
        </li>
        <li id="tool-btn-cancel" class="enabled-tool-btn">
            <div class="enabled-cancel-icon tool-icon"></div>
            <span>Cancel</span>
        </li>
    </ul>
</div>
<script>
    $('#tool-btn-cancel').click(function () {
        location.href = '/classico/public/admin/<?= $controllerName ?>/index';
    });
</script>
<script type="text/javascript">
    var actionName = '<?= $actionName ?>';
    if (actionName == 'update') {
        $('#tool-btn-applynnew').removeClass('enabled-tool-btn');
        $('#tool-btn-applynnew > div')
            .removeClass('enabled-applynclose-icon')
            .addClass('disabled-applynclose-icon');
    }
</script>
